<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('代理商费率模版列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 100px;">费率模板编号：</label>
                                <input type="text" name="arMark"/>
                            </li>
                            <!--<li>
                                <label style="width: 100px;">是否默认：</label>
                                <select name="isdefault" th:with="type=${@dict.getType('isDefault')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>-->
                            <li>
                                <label style="width: 100px;">费率模板名称：</label>
                                <input type="text" name="arName"/>
                            </li>
                            <li>
                                <label style="width: 100px;">模版类型：</label>
                                <select name="merType" th:with="type=${@dict.getType('modelType')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 10px;"></label>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('agentRateInfo:agentRateInfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('agentRateInfo:agentRateInfo:remove')}]];
        var isdefaultDatas = [[${@dict.getType('isDefault')}]];
        var merTypeDatas = [[${@dict.getType('modelType')}]];
        var prefix = ctx + "agentRateInfo";

        $(function() {
            var options = {
                url: prefix + "/belongList",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "代理商费率模版",
                firstLoad:true,
                clickToSelect:true,
                columns: [{
                    radio: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'arMark',
                    title: '费率模板编号',
                    align: 'center',
                    visible: false
                },
                {
                    field: 'arName',
                    title: '费率模板名称',
                    align: 'center'
                },
               {
                    field: 'fjArMark',
                    title: '附加费率编号',
                    align: 'center',
                   visible: false
                },
                {
                    field: 'fjArMarkName',
                    title: '附加费',
                    align: 'center'
                },
                /*{
                    field: 'isdefault',
                    title: '是否默认',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(isdefaultDatas, value);
                    },
                    align: 'center'
                },*/
               /* {
                    field: 'merType',
                    title: '模版类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(merTypeDatas, value);
                    },
                    align: 'center'
                },*/

                ]
            };
            $.table.init(options);
        });

        function submitHandler(index, layero) {
            var arMark = $.table.selectColumns("arMark");
            var arName = $.table.selectColumns("arName");
            var fjArMark = $.table.selectColumns("fjArMark");
            var fjArMarkName = $.table.selectColumns("fjArMarkName");

            if (arName.length == 0) {
                $.modal.alertWarning("请至少选择一个模版");
                return;
            }
            $.modal.close();
            //修改父页面值
            parent.$("#arMark").val(arMark);
            parent.$("#arName").val(arName);
            parent.$("#fjArMark").val(fjArMark);
            parent.$("#fjArMarkName").val(fjArMarkName);

        }

    </script>
</body>
</html>